﻿using Coding4Fun.MissionControl.WP.Misc;
using Coding4Fun.MissionControl.WP.Models;
using Coding4Fun.MissionControl.WP.Network;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Coding4Fun.MissionControl.WP.ViewModels
{
    public class CommonViewModel : BindableBase
    {
        static CommonViewModel instance = null;
        static readonly object padlock = new object();

        public CommonViewModel()
        {
            CommandClient = new CommandClient();
        }

        public static CommonViewModel Instance
        {
            get
            {
                lock (padlock)
                {
                    if (instance == null)
                    {
                        instance = new CommonViewModel();
                    }
                    return instance;
                }
            }
        }

        public CommandClient CommandClient;

        private bool _isWaiting;
        public bool IsWaiting
        {
            get
            {
                return _isWaiting;
            }
            set
            {
                SetProperty(ref _isWaiting, value, "IsWaiting");
            }
        }

        private string _currentSetType;
        public string CurrentSetType
        {
            get
            {
                return _currentSetType;
            }
            set
            {
                SetProperty(ref _currentSetType, value, "CurrentSetType");
            }
        }

        private Server _currentServer;
        public Server CurrentServer
        {
            get
            {
                return _currentServer;
            }
            set
            {
                SetProperty(ref _currentServer, value, "CurrentServer");
            }
        }

        private string _currentSet;
        public string CurrentSet
        {
            get
            {
                return _currentSet;
            }
            set
            {
                SetProperty(ref _currentSet, value, "CurrentSet");
            }
        }
    }
}
